import request from 'utils/request/request';
import Config from 'utils/api'
import { createTheURL } from 'utils/utils';
import { REQUEST_HEADER_LIST } from 'utils/request/requestHeader'

export function getVerificationCode(params) {
    return request(createTheURL(Config.SMS_CODE, 'sms-code'), {
        method: 'post',
        body: params
    })
}


export function submitSMSAuthentication(params) {
    return request(createTheURL(Config.ENVELOPE + '/' + params.envelopeWsid + '/participants/' + params.participantWsid, 'direct-pfx-on-time-confirm'), {
        method: 'post',
        body: params.query
    }, REQUEST_HEADER_LIST.DEFAULT, {
        'X-Requested-Contact': params.phone,
        'X-Requested-Captcha': params.vCode
    })
}


export function getFormSearch(params) {
    return request(createTheURL(Config.ENVELOPE + '/' + params.envelopeWsid + '/participants/' + params.participantWsid, 'forms'), {
        method: 'get',
        body: params.query
    })
}